<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarkeluargakandung.php
 * @author ranuandra
 *
 * 7 Jun 2012 14:01:32
 *
 * 
 */

class Model_Pelamarkeluargakandung extends ORM
{
	protected $_belongs_to = array(
	        'mstpelamar' 		=> array('model'	 => 'mstpelamar'),
			'mstkeluarga'		=> array('model'	 => 'mstkeluarga'),
			'mstpendidikan'		=> array('model'	 => 'mstpendidikan'),
			'mstagama'			=> array('model'	 => 'mstagama',)
	);
	
	private $_field = array('nama', 'tempat_lahir', 'tgl_lahir', 'jenis_kelamin', 'mstpendidikan_id', 'mstagama_id', 'pekerjaan', 'mstkeluarga_id', 'flag');
	private $_form = array('nama' 				=> '', 
							'tempat_lahir'		=> '',
							'tgl_lahir'			=> '',
							'jenis_kelamin'		=> '',
							'mstpendidikan_id'	=> '',
							'mstagama_id'		=> '',
							'pekerjaan'			=> '',
							'mstkeluarga_id'	=> '',
							'flag'				=> '',
	                      );
	
	public $rules = array(
					'nama' 	 => array(
									array('min_length', array(':value', 0)),
								),
					'tempat_lahir' => array(
									array('min_length', array(':value', 0)),
								),
					'tgl_lahir' => array(
									array('min_length', array(':value', 0)),
								),
					'jenis_kelamin' => array(
									array('min_length', array(':value', 0)),
								),
					'mstpendidikan_id' => array(
									array('min_length', array(':value', 0)),
								),
					'mstagama_id' => array(
									array('min_length', array(':value', 0)),
								),
					'pekerjaan' => array(
									array('min_length', array(':value', 0)),
								),
					'mstkeluarga_id' => array(
									array('min_length', array(':value', 0)),
								),
					'flag' => array(
									array('min_length', array(':value', 0)),
								),
	);
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
		
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}
}